<template>
	<view class="content">
		<view>
			<rich-text :nodes="content"></rich-text>
		</view>
		<view class="footer">
			<view class="wrap flex-all">
				<image class="sign" v-if="ship.from_sign" :src="IMG_URL + ship.from_sign" alt="" mode="widthFix" />
				<view  v-else class="sign">我的签名</view>
				<image class="sign" v-if="ship.to_sign" :src="IMG_URL + ship.to_sign" alt="" mode="widthFix" />
				<view v-else class="sign">另一半签名</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		userAgree,
	} from "../../api/login.js"
	import {
		IMG_URL,
	} from "../../config/app.js";
	export default {
		name: 'coupleAgree', // 情侣协议
		data() {
			return {
				IMG_URL: IMG_URL,
				value: '',
				ship:{},
				type:'',
				content:''
			}
		},
		onLoad(query) {
			console.log(query, '过来了-----------');
			this.ship = JSON.parse(query.ship)
			if(this.ship.type==1){
				this.type = 'love'
			}
			if(this.ship.type==2){
				this.type = 'bestie'
			}
			this.getData()
		},
		mounted() {
			
		},
		methods: {
			toJump(url) {
				if (!url) return
				uni.navigateTo({
					url
				});
			},
			//获取协议
			async getData() {
				let res = await userAgree(this.type)
				this.content = res.data.agreement_content
			}
		}
	}
</script>
<style lang="scss" scoped>
	.content {
		padding: 0rpx 30rpx 30rpx;
		overflow: auto;

		// .scroll-content {
		//   width:100%;
		//   height:calc(100vh - var(--status-bar-height));
		// }
		.title {
			font-weight: bold;
			font-size: 34rpx;
			color: $uni-text-color;
			padding: 30rpx 0;
		}

		.info {
			font-size: 28rpx;
			color: $uni-text-color;
			line-height: 1.5;
		}

		.footer {
			width: 100%;
			height: 340rpx;
			background: #F6F6F6;
			border-radius: 30rpx 30rpx 0px 0px;
			position: fixed;
			bottom: 0;
			left: 0;
			right: 0;
			padding: 30rpx;

			.wrap {
				width: 100%;
				height: 100%;
				background: #fff;
				padding: 40rpx 45rpx;

				.sign {
					width: 281rpx;
					line-height: 201rpx;
					text-align: center;
					border-radius: 20rpx;
					border: 1px solid #DDDDDD;
					font-weight: bold;
					font-size: 36rpx;
					color: #CCCCCC;
				}
			}
		}
	}
</style>